<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <!--<img class="banner-img"-->
           <!--src="http://img1.qunarzz.com/sight/p0/201403/07/dca171d32e20adbf141e7f8f91b71c0e.jpg_350x240_fc4ae068.jpg"-->
           <!--alt="北京天文馆">     -->
      <img class="banner-img"
           :src="bannerImg"
           alt="北京天文馆">
      <div class="banner-info">
        <!--<div class="banner-tittle">北京天文馆(AAA景区)</div>-->
        <div class="banner-tittle">{{sightName}}</div>
        <div class="banner-number">
          <span class="iconfont">&#xe63b;</span>
          39
        </div>
      </div>
    </div>
    <fade-animation>
    <common-gallary
      :imgs="imgs"
      v-if="showGallary"
      @close="handleGallaryClose"

    >
    </common-gallary>
    </fade-animation>
  </div>

</template>

<script>
  import CommonGallary from 'common/gallary/Gallary'
  import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    bannerImgs: Array
  },
  data () {
    return {
      showGallary: false,
      imgs:[
        'http://img1.qunarzz.com/sight/p0/1501/d0/d00d72664c3e73d8.water.jpg_350x240_4d2c58d5.jpg',
        'http://img1.qunarzz.com/sight/p0/1501/6d/6da2214f48a9e93a.water.jpg_350x240_34c0c85f.jpg',
        'http://img1.qunarzz.com/sight/p0/201403/07/e706489fc18be7f211e6f0d55ecc48cf.jpg_350x240_24b831cd.jpg',
        'http://img1.qunarzz.com/sight/p0/1501/d6/d68473e407962ff3.water.jpg_350x240_a83cd4a3.jpg',
        'http://img1.qunarzz.com/sight/p0/201403/07/96082a4d84c8656e3be740f67bcd70ce.jpg_350x240_c5796659.jpg'
      ]
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  }

}
</script>

<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  .banner
    position: relative
    overflow: hidden
    height: 0
    padding-bottom: 55%
    .banner-img
      width: 100%
    .banner-info
      display: flex
      position: absolute
      /* 左跟右都写，代表两边对齐 */
      left: 0
      right: 0
      bottom: 0
      line-height: .6rem
      color: #fff
      /*  渐变使用。透明度变化 */
      background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))
      .banner-tittle
        flex: 1
        font-size: .32rem
        padding: 0 .2rem
      .banner-number
        height: .32rem
        line-height: .32rem
        margin-top: .14rem
        padding: 0 .4rem
        border-radius: .2rem
        background: rgba(0, 0, 0, .8)
        font-size: .24rem
        .banner-icon
          font-size: .24rem
</style>
